<?php
namespace app\api\controller\v1;
use think\admin\Controller;
use think\Response;
use app\data\model\DataDevice;
use app\data\model\DataDeviceLog;
use app\data\model\DataCat;
use app\data\service\DeviceService;
use app\data\service\IotThingService;
/**
 * 灯光数据接口
 * @class Light
 * @package app\api\controller\v1
 *
 */
class Light extends Controller
{
    public function get(){
        $id = input('get.id');//设备iotId
        $service_dev = new DeviceService();
        $settings = $service_dev->getDevicePro($id);
        //6随机颜色
        $color_data = [
            '0'=>sysconf('device.color1'),
            '1'=>sysconf('device.color2'),
            '2'=>sysconf('device.color3'),
            '3'=>sysconf('device.color4'),
            '4'=>sysconf('device.color5'),
            '5'=>sysconf('device.color6')
        ];
        $res['Light'] =$settings['Light'];
        $res['random_color']=$color_data;
        $this->success('success',$res);
    }
}
